<?php if (count($topics) === 0) { ?>

	<p>No topics found. <a href="<?php echo url::site('pianissiboard/post') ?>">Post the first one!</a></p>

<?php } else { ?>

	<ul>
	<?php foreach ($topics as $topic) { ?>

		<li>
			<a href="<?php echo url::site('pianissiboard/topic/'.$topic->id.'/'.$topic->slug) ?>">
				<?php echo html::specialchars($topic->title) ?>
			</a><br />
			Total posts: <?php echo $topic->post_count ?><br />
			<a href="<?php echo url::site('pianissiboard/topic/'.$topic->id.'/'.$topic->slug.'/post/'.$topic->last_post_id) ?>">
				Last post by <?php echo html::specialchars($topic->last_post_author) ?> (<?php echo strftime('%e %B %Y', $topic->last_post_date) ?>)
			</a>
		</li>

	<?php } ?>
	</ul>

	<?php echo $pagination ?>

<?php } ?>